/****** Object:  Table [dbo].[restricteduielements_roleprivileges]    Script Date: 10/08/2012 20:12:06 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[restricteduielements_roleprivileges]') AND type in (N'U'))
DROP TABLE [dbo].[restricteduielements_roleprivileges]
GO

/****** Object:  Table [dbo].[restricteduielements_roleprivileges]    Script Date: 10/08/2012 20:12:07 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[restricteduielements_roleprivileges](
	[id] [int] IDENTITY(1,1) NOT NULL,	
	[uielementid] [int] NOT NULL,
	[roleid] [int] NOT NULL,	
PRIMARY KEY NONCLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[restricteduielements_roleprivileges]  WITH CHECK ADD FOREIGN KEY([uielementid])
REFERENCES [dbo].[restricteduielements] ([id])
GO

ALTER TABLE [dbo].[restricteduielements_roleprivileges]  WITH CHECK ADD FOREIGN KEY([roleid])
REFERENCES [dbo].[role] ([id])
GO


